package com.shop.service;

import com.shop.dao.ImageDao;
import com.shop.entity.Image;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.annotation.RequestScope;

import java.util.List;

@RestController
@RequestScope//用于刷新
public class ImageServiceRest {
    @Autowired
    private ImageDao imageDao;
    /***
     * 通过类型获取图片
     * @return
     */
    @RequestMapping("getImageByType")
    public List<Image> getImageByType(int type){
        Image i = new Image();
        i.setType(type);
        //查询上线数据
        i.setStatus(1);
        return imageDao.queryAll(i);
    }
}
